<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
  <script src="../../js/vue.js"></script>  <!-- vue追加 -->
  <script src="../../js/axios.min.js"></script>		<!-- vue的AJAX追加 -->
 
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
 	
<style type="text/css">
	#empinfo{
		margin-top: 30px;
		margin-left: 80px;
		
	}
	
</style>
</head>
<body>
<br/>
<!-- 更改信息页 -->
<h2 >个人信息添加页面</h2>

<div id="empinfo" style="">
	
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="empName"  type="text" name="title" placeholder="请输入姓名" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="empPassword"  type="text" name="title" placeholder="请输入密码" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="empGender"  type="text" name="title" placeholder="请输入性别" autocomplete="off" class="layui-input">
	</div>	
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="empTel"  type="text" name="title" placeholder="请输入电话" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="empIdcard"  type="text" name="title" placeholder="请输入身份证号码" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="hospitalId"  type="text" name="title" placeholder="请输入所属医院编号" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="officeId"  type="text" name="title" placeholder="请输入所属科室编号"  autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="depId"  type="text" name="title" placeholder="请输入所属部门编号 " autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input type="button"  @click="addemp" value="提交个人信息" style="margin-left: 100px" class="layui-btn layui-btn-radius"/><br/>
	</div>
</div>

<script >
	var empinfo=new Vue({
		el:"#empinfo",
		
		data:{
			empName:"",
			empPassword:"",
			empGender:"",
			empHiredate:"",
			empTel:"",
			empIdcard:"",
			hospitalId:"",
			officeId:"",
			depId:"",
			
		},
		
		methods:{
			addemp:function(){
				axios.get(
					"http://localhost:8080/addEmp?empName="+this.empName+"&empPassword="
						+this.empPassword+"&empGender="+this.empGender+"&empHiredate="+this.empHiredate
						+"&empHiredate="+this.empHiredate+"&empTel="+this.empTel+"&empIdcard="+this.empIdcard
						+"&hospitalId="+this.hospitalId+"&officeId="+this.officeId+"&depId="+this.depId
					
				).then(data=>{					
					alert(data.data.msg);
				}).catch(err=>{
					alert(err.data.msg);
				})
			}
			
		}
		
		
	})
</script>

</body>
</html>